Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds support for PRIVATE endpoint type for aws_api_gateway_rest_api #4888

Merged
merged 2 commits into from
Jun 20, 2018
Merged

Adds support for PRIVATE endpoint type for aws_api_gateway_rest_api #4888

merged 2 commits into from
Jun 20, 2018

Conversation

edsonmarquezani
Copy link

Changes proposed in this pull request:

  • Adds support for private API Gateways[1]

[1] https://aws.amazon.com/blogs/compute/introducing-amazon-api-gateway-private-endpoints/

Output from acceptance testing:

$ make testacc TESTARGS='-run=TestAccAWSAPIGatewayRestApi_EndpointConfiguration'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./... -v -run=TestAccAWSAPIGatewayRestApi_EndpointConfiguration -timeout 120m
?   	github.com/terraform-providers/terraform-provider-aws	[no test files]
=== RUN   TestAccAWSAPIGatewayRestApi_EndpointConfiguration
--- PASS: TestAccAWSAPIGatewayRestApi_EndpointConfiguration (136.90s)
PASS
ok  	github.com/terraform-providers/terraform-provider-aws/aws	136.921s
...

Comments

My Golang knowledge is vey limited, but instead of asking for this feature, I thought I could do it myself and contribute. The change is quite simple, yet I'm not sure the acceptance test I added is correct. Please tell me if not.
I built and tested it and it works.

@ghost ghost added the size/S Managed by automation to categorize the size of a PR. label Jun 20, 2018
@bflad bflad added enhancement Requests to existing resources that expand the functionality or scope. service/apigateway Issues and PRs that pertain to the apigateway service. labels Jun 20, 2018
@bflad bflad added this to the v1.24.0 milestone Jun 20, 2018
Copy link
Contributor

@bflad bflad left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @edsonmarquezani, thanks for submitting this! 🚀

As detailed below, I will go ahead and make the more advanced testing adjustments in a commit after yours so we can get this released today and continue to support GovCloud (US) testing with this resource.

@@ -203,6 +203,24 @@ func TestAccAWSAPIGatewayRestApi_EndpointConfiguration(t *testing.T) {
},
},
})

resource.Test(t, resource.TestCase{
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We generally prefer to create whole new top level acceptance test functions instead of adding multiple resource.Test() within the same function -- this allows us to parallelize our testing better. 😄

Another complicated piece to our API Gateway testing here is that we run the service testing across multiple AWS partitions (Commercial and GovCloud (US)), which the latter may or may not support the new PRIVATE REST API endpoint type. If you look at the TestStep above your addition here, we have a PreConfig function that ensures the AWS API Gateway service its calling supports the EDGE endpoint type or skips the rest of the test. We'll want to add something similar for PRIVATE as well.

Do not be discouraged here though! There just happens to be more advanced testing handling with this resource testing than other parts of our resource testing. You actually were on the right track except the tweaks mentioned above, which I can handle in a commit after yours to expedite releasing this enhancement for everyone. 👍

Copy link
Author

@edsonmarquezani edsonmarquezani Jun 20, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, I get it. I just didn't know private type might not be supported in some regions.

As for the remaing, I understand you're going to make the adjustments yourself, right? Anyway, feel free to ask for it, if you want to. I think I could handle it. ;)

@bflad bflad merged commit 65da437 into hashicorp:master Jun 20, 2018
bflad added a commit that referenced this pull request Jun 20, 2018
@bflad
Copy link
Contributor

bflad commented Jun 25, 2018

This has been released in version 1.24.0 of the AWS provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading.

@ghost
Copy link

ghost commented Apr 5, 2020

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thanks!

@ghost ghost locked and limited conversation to collaborators Apr 5, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement Requests to existing resources that expand the functionality or scope. service/apigateway Issues and PRs that pertain to the apigateway service. size/S Managed by automation to categorize the size of a PR.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants